From: Debarshi Ray Date: Fri, 31 Aug 2012 22:49:14 +0000 (+0200) Subject: boxpointer: Use the -arrow-rise as padding instead of a magic number X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~5988 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=43caace1b6918890fd9b5893ffd2cf34406089a5;p=gnome-shell.git boxpointer: Use the -arrow-rise as padding instead of a magic number This makes sense if we want to follow what the following comment says: // We also want to keep it onscreen, and separated from the // edge by the same distance as the main part of the box is // separated from its sourceActor Using a magic number violates the "separated from the edge ... separated from its sourceActor" part. https://bugzilla.gnome.org/show_bug.cgi?id=682343 --- diff --git a/js/ui/boxpointer.js b/js/ui/boxpointer.js index 03d114bac..17c18016e 100644 --- a/js/ui/boxpointer.js +++ b/js/ui/boxpointer.js @@ -410,6 +410,7 @@ const BoxPointer = new Lang.Class({ let themeNode = this.actor.get_theme_node(); let gap = themeNode.get_length('-boxpointer-gap'); + let padding = themeNode.get_length('-arrow-rise'); let resX, resY; @@ -435,8 +436,8 @@ const BoxPointer = new Lang.Class({ case St.Side.BOTTOM: resX = sourceCenterX - (halfMargin + (natWidth - margin) * alignment); - resX = Math.max(resX, monitor.x + 10); - resX = Math.min(resX, monitor.x + monitor.width - (10 + natWidth)); + resX = Math.max(resX, monitor.x + padding); + resX = Math.min(resX, monitor.x + monitor.width - (padding + natWidth)); this.setArrowOrigin(sourceCenterX - resX); break; @@ -444,8 +445,8 @@ const BoxPointer = new Lang.Class({ case St.Side.RIGHT: resY = sourceCenterY - (halfMargin + (natHeight - margin) * alignment); - resY = Math.max(resY, monitor.y + 10); - resY = Math.min(resY, monitor.y + monitor.height - (10 + natHeight)); + resY = Math.max(resY, monitor.y + padding); + resY = Math.min(resY, monitor.y + monitor.height - (padding + natHeight)); this.setArrowOrigin(sourceCenterY - resY); break;